//--------------------------------------------------------------
//
// Qizhi Zhang 
// ezhung@gmail.com
// http://www.moorwind.com
//
//--------------------------------------------------------------
package reader.dao
{
	import __AS3__.vec.Vector;
	
	import reader.model.vo.BlogDraftVO;
	import reader.model.vo.UserVO;
	
	public interface IDraftDAO
	{
		function insertDraft(draft:BlogDraftVO, user:UserVO):int;
		
		function updateDraft(draft:BlogDraftVO):Boolean;
		
		function updatePublishedDraft(draft:BlogDraftVO):Boolean;
		
		function publishDraft(draft:BlogDraftVO, user:UserVO):int;
		
		function deleteDraft(draft:BlogDraftVO):Boolean;
		
		function deleteDraftByUser(user:UserVO):Boolean;
		
		function deleteDrafts(drafts:Vector.<BlogDraftVO>):void;
		
		function selectDraft(draftid:int):BlogDraftVO;
		
		function selectUnPublishedDrafts(userid:int, prefetch:int = -1):Vector.<BlogDraftVO>
		
		function selectPublishedDrafts(userid:int, prefetch:int = -1):Vector.<BlogDraftVO>;
		
		function selectAllDrafts(userid:int):Vector.<BlogDraftVO>;
		
		function getCount(user:UserVO):uint;
		
		function getDraftCount(user:UserVO):uint;
	}
}